package com.itheima.properties;

import java.util.Properties;
import java.util.Set;

/*
properties 独有的方法
为配置文件服务
property  就是一个配置项
 */
public class Demo02 {

    public static void main(String[] args) {
        Properties prop = new Properties();
//  相当于  put
        prop.setProperty("maxAge","120");
        prop.setProperty("minAge","18");
        prop.setProperty("normalAge","30");
//相当于 get


        String maxAge = prop.getProperty("maxAge");
        String minAge = prop.getProperty("minAge");
        String normalAge = prop.getProperty("normalAge");
        System.out.println(maxAge);
        System.out.println(minAge);
        System.out.println(normalAge);

        //相当于 keySet
        Set<String> propertyNames = prop.stringPropertyNames();
        System.out.println(propertyNames);

        for (String propertyName : propertyNames) {
            System.out.println(propertyName+"***"+prop.getProperty(propertyName));
        }

    }


}
